package cn.sciento.message.config;


import cn.sciento.common.STongService;
import cn.sciento.core.swagger.ChoerodonRouteData;
import org.springframework.beans.factory.annotation.Autowired;

import cn.sciento.swagger.annotation.ChoerodonExtraData;
import cn.sciento.swagger.swagger.extra.ExtraData;
import cn.sciento.swagger.swagger.extra.ExtraDataManager;

/**

 */
@ChoerodonExtraData
public class MessageExtraDataManager implements ExtraDataManager {

    @Autowired
    private org.springframework.core.env.Environment environment;

    @Override
    public ExtraData getData() {
        ChoerodonRouteData choerodonRouteData = new ChoerodonRouteData();
        choerodonRouteData.setName(environment.getProperty("stong.service.current.name", STongService.Message.CODE));
        choerodonRouteData.setPath(environment.getProperty("stong.service.current.path", STongService.Message.PATH));
        choerodonRouteData.setServiceId(environment.getProperty("stong.service.current.service-name", STongService.Message.NAME));
        choerodonRouteData.setPackages("cn.sciento.message");
        extraData.put(ExtraData.ZUUL_ROUTE_DATA, choerodonRouteData);
        return extraData;
    }
}
